<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <!--1.修饰符：lazy (失去焦点才同步数据)-->
  <input type="text" v-model.lazy="message">
  <h2>{{message}}</h2>

  <!--2.修饰符：number(不加这个即使输入数字也会是string类型)-->
  <input type="number" v-model.number="age">
  <h2>{{age}} -- {{typeof age}}</h2>

  <!--3.修饰符：trim(去除前后空格)-->
  <input type="text" v-model.trim="name">
  <h2>{{name}}</h2>
</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '你好啊',
      age: 18,
      name: ''
    }
  })
</script>

</body>
</html>
